#include <bits/stdc++.h>
#include <string>
using namespace std;

string to_num_string(string& sourceWord){
    string res;
    for(auto& chr: sourceWord){
        res += chr - 'a' + '0';
    }
    return res;
}

bool isSumEqual(string firstWord, string secondWord, string targetWord) {
    int first, second, target;
    firstWord = to_num_string(firstWord);
    secondWord = to_num_string(secondWord);
    targetWord = to_num_string(targetWord);
    first = stoi(firstWord.c_str());
    second = stoi(secondWord.c_str());
    target = stoi(targetWord.c_str());

    return first + second == target;
}

int main(){
    string firstWord = "acb", secondWord = "cba", targetWord = "cdb";
    cout<<isSumEqual(firstWord, secondWord, targetWord);
    return 0;
}